//
//  String-Ex.swift
//  手账
//
//  Created by zhuxiaoxiang on 2018/11/15.
//  Copyright © 2018年 zhuxiaoxiang. All rights reserved.
//

import Foundation

extension String {
    func judgeIfMobileCode() -> Bool {
        let mobile = "^1(3[0-9]|4[57]|5[0-35-9]|8[0-9]|7[0678])\\d{8}$"
        let regexmobile = NSPredicate(format: "SELF MATCHES %@", mobile)
        return regexmobile.evaluate(with:self)
    }
}
